STEP 9: Each time the loop counts the frequency of a value in the sample_space, we'll store that count in a list.

Lists store values in order, so the first number in our freq_list links to the first value in our sample_space.

  • In LOGIC, click on . Drag Append into your loop.
  • Change the list variable name in front from my_list to freq_list.
  • Change the variable argument in .append() from my_var to freq.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)